import { Length } from "class-validator";
import { BaseEntity } from "src/baseEntity";
import { Dept } from "src/dept/dept.entity";
import { UserSys } from "src/user/userSys.entity";
import { Column, Entity, OneToMany } from "typeorm";



@Entity("system")
export class System extends BaseEntity {
    @Column({ unique: true })
    @Length(1, 15)
    name: string

    @OneToMany(() => UserSys, type => type.system)
    persons: UserSys[]

    @OneToMany(() => Dept, type => type.system)
    dept: Dept[]

    @Column({ nullable: true })
    comment: string

    responsibilitys?: UserSys[]
}